Skip to content

fix(cdm): let a tracked bar find its debuff on the target - #1997

Open
dfrisone wants to merge 3 commits into
EllesmereGaming:mainfrom
dfrisone:fix/tbb-target-aura-fallback
Open

fix(cdm): let a tracked bar find its debuff on the target#1997
dfrisone wants to merge 3 commits into
EllesmereGaming:mainfrom
dfrisone:fix/tbb-target-aura-fallback

Conversation

@dfrisone

@dfrisone dfrisone commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the tracked-bar fallback for player-applied auras on the target when the Blizzard viewer has not bound an active aura. Reported by guld on 9.1.6 after a macro temporarily clears/switches/restores the target while bleeds are active.

The existing player-aura lookup remains first. The target fallback uses GetAuraDataBySpellName with HARMFUL|PLAYER, or HELPFUL|PLAYER for a friendly target. Ownership is filtered engine-side; no sourceUnit field is inspected. Spell and base-spell names are cached per configuration in a weak-key table and invalidated when their configured IDs change.

PLAYER_TARGET_CHANGED goes through the existing sleeper Probe, extended with the same target lookup for eligible fallback configurations. An empty probe leaves the ticker parked. The cooldown-hooks generation bump on target changes remains unchanged.

How was it tested?

  • Lua 5.1 compilation and EUI style checks passed.
  • Stubbed execution of the actual helper, Probe and OnEvent verified hostile/friendly filters, cache reuse and ID invalidation, no-target early return, no aura-field inspection, empty/disabled target changes staying asleep, target aura presence waking, and the existing cast wake path.
  • In-game verification is pending: test the reported macro with a player bleed active, another player's copy alone and both copies together, in open world and restricted content. Also check friendly-target buffs and repeated empty target switches while parked.
  • No new per-frame allocations after names are cached; no additional frame or polling timer. Target queries run through the existing fallback/probe paths.

Screenshots

Before/after screenshots are not supplied. In-game validation remains pending.

Checklist

  • New settings default OFF (no behavior change without opt-in) - N/A: bug fix, no new settings.
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no frames built - existing tracked-bar lifecycle; target wake is probed.
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations) - uses existing ticker and sleeper, memoized spell names.
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames - reads only; external weak cache.
  • Tested in-game on live; no version gates or pre-Midnight APIs added - in-game testing pending; no compatibility gates added.

Reported for a rogue Blind macro that sets focus to the target, clears the
target, targets and blinds someone else, then restores the original target
from focus, all inside one macro. Afterwards the player's bleeds on that
target stop showing on the tracked bar until they switch target and back.

The stall is Blizzard's. CooldownViewerMixin:OnPlayerTargetChanged only
refreshes when UnitGUID("target") differs from the one it stored, and this
macro ends on the GUID it started with, so the refresh never runs and the
item stays inactive. Its frame-scoped aura cache is keyed on unit token and
stamped with GetTime(), and nothing on the target-change path marks it dirty,
so a second target change inside one frame reads the stale list.

Our display is a faithful mirror of that, so it goes quiet with it. But the
bind-miss fallback that already exists for "the viewer has not bound this aura
yet" only ever asked GetPlayerAuraBySpellID, which cannot see a debuff on
somebody else. It now asks the target too, so the bar rides out the stall.

Only a readable sourceUnit mismatch rejects the aura, so another player's copy
of the same debuff cannot drive the bar while an unreadable one still shows.
Field reads need no new guarding: the consumer already classifies duration,
expirationTime and applications before comparing them.

PLAYER_TARGET_CHANGED joins both tick wake sets as well. Target-applied auras
bind and release on that edge and on no player-scoped one, so a parked ticker
had no way to learn a new target already carried a tracked debuff.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant